package com.vcms.cms.entity;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Comment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "comment", catalog = "vcms_0.1")
public class Comment implements java.io.Serializable {

	// Fields

	private Integer commentId;
	private User userByUserId;
	private User userByUseUserId;
	private Site site;
	private Timestamp createTime;
	private Timestamp replayTime;
	private Integer ups;
	private Integer downs;
	private Boolean isRecommend;
	private Boolean isChecked;
	private Set<CommentExt> commentExts = new HashSet<CommentExt>(0);

	// Constructors

	/** default constructor */
	public Comment() {
	}

	/** full constructor */
	public Comment(User userByUserId, User userByUseUserId, Site site,
			Timestamp createTime, Timestamp replayTime, Integer ups,
			Integer downs, Boolean isRecommend, Boolean isChecked,
			Set<CommentExt> commentExts) {
		this.userByUserId = userByUserId;
		this.userByUseUserId = userByUseUserId;
		this.site = site;
		this.createTime = createTime;
		this.replayTime = replayTime;
		this.ups = ups;
		this.downs = downs;
		this.isRecommend = isRecommend;
		this.isChecked = isChecked;
		this.commentExts = commentExts;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "commentId", unique = true, nullable = false)
	public Integer getCommentId() {
		return this.commentId;
	}

	public void setCommentId(Integer commentId) {
		this.commentId = commentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUserByUserId() {
		return this.userByUserId;
	}

	public void setUserByUserId(User userByUserId) {
		this.userByUserId = userByUserId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "use_userId")
	public User getUserByUseUserId() {
		return this.userByUseUserId;
	}

	public void setUserByUseUserId(User userByUseUserId) {
		this.userByUseUserId = userByUseUserId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "siteId")
	public Site getSite() {
		return this.site;
	}

	public void setSite(Site site) {
		this.site = site;
	}

	@Column(name = "createTime", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "replayTime", length = 19)
	public Timestamp getReplayTime() {
		return this.replayTime;
	}

	public void setReplayTime(Timestamp replayTime) {
		this.replayTime = replayTime;
	}

	@Column(name = "ups")
	public Integer getUps() {
		return this.ups;
	}

	public void setUps(Integer ups) {
		this.ups = ups;
	}

	@Column(name = "downs")
	public Integer getDowns() {
		return this.downs;
	}

	public void setDowns(Integer downs) {
		this.downs = downs;
	}

	@Column(name = "isRecommend")
	public Boolean getIsRecommend() {
		return this.isRecommend;
	}

	public void setIsRecommend(Boolean isRecommend) {
		this.isRecommend = isRecommend;
	}

	@Column(name = "isChecked")
	public Boolean getIsChecked() {
		return this.isChecked;
	}

	public void setIsChecked(Boolean isChecked) {
		this.isChecked = isChecked;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "comment")
	public Set<CommentExt> getCommentExts() {
		return this.commentExts;
	}

	public void setCommentExts(Set<CommentExt> commentExts) {
		this.commentExts = commentExts;
	}

}